home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / scvs.me < prev    next >
Encoding:
Text File  |  1992-12-14  |  9.8 KB  |  284 lines

  1. '\"  This is a cheat sheet for using SCVS.
  2. .fo ''%''
  3. .lp
  4. .sz +4
  5. .ce
  6. \fBSCVS Cheat Sheet\fP
  7. .sz -4
  8. .sp
  9. .ce
  10. November 3, 1991
  11. .sp
  12. .pp
  13. The SCVS Cheat Sheet explains some of the standard uses of \fBscvs\fP.
  14. If you want to do something that is not covered here you should 
  15. refer to the
  16. man pages for \fBscvs\fP, \fBcvs\fP, and \fBrcs\fP.
  17. \fBScvs\fP manages source directory trees called \fImodules\fP.
  18. \fBScvs\fP modules for the kernel correspond to what we've traditionally
  19. called modules, e.g. net, timer, mach, etc.
  20. The "master" copy of the modules is stored in the \fIrepository\fP,
  21. which is a directory tree of RCS files rooted at 
  22. \fC/sprite/src/kernel/Cvsroot\fP.
  23. In order to modify the source for a module you must first get your
  24. own copy of the module.
  25. Make your changes in your copy, and when you are satisfied with them
  26. commit your changes to the repository.
  27. Your changes are not applied to the repository until you commit them,
  28. at which time they become the "latest" version of the sources.
  29. Throughout this cheat sheet the term "latest version" refers to 
  30. the current
  31. version of the sources in the repository.
  32. .(b
  33. .ip "\fBHow do I get a copy of a module?\fP"
  34. .sp
  35. Copies of kernel modules are usually kept in your kernel build directory
  36. (\fC/sprite/src/kernel/\fP\fIusername\fP). 
  37. In this directory type \fBscvs co\fP \fImodule\fP.
  38. A subdirectory called \fImodule\fP will be created,
  39. and it will be populated
  40. with the current version of the module.  
  41. You will be told about other users that have a copy of the module
  42. checked out, including any other copies you might have.
  43. You may want to check with these people to make sure that your changes
  44. will be compatible.
  45. If you don't intend to commit your changes to the repository
  46. then you should use the \fB\-i\fP option so that other
  47. users are not told about your copy.
  48. .sp
  49. After the checkout is complete you need to run \fBmkmf\fP in your copy
  50. to create a Makefile, dependencies.mk, etc.
  51. .sp
  52. It is ok to re-checkout a module if you
  53. checked it out before and still have the source tree.
  54. .)b
  55.  
  56. .(b
  57. .ip "\fBHow do I get information about the status of my copy of a module?\fP"
  58. .sp
  59. Once you have a copy of a module you may want some information about
  60. the files in your copy, 
  61. like which ones you've modified and
  62. which ones are out-of-date with the latest version. 
  63. \fBscvs info\fP will tell you what
  64. you want to know.  Here's what its output means:
  65. .(l
  66. \fBU\fP \fIfile\fP    Your copy of \fIfile\fP needs to be updated.
  67. \fBM\fP \fIfile\fP    You've modified \fIfile\fP.
  68. \fBC\fP \fIfile\fP    You've modified \fIfile\fP, and it is also out-of-date.
  69. \fBA\fP \fIfile\fP    You've added \fIfile\fP.
  70. \fBR\fP \fIfile\fP    You've removed \fIfile\fP.
  71. \fBD\fP \fIfile\fP    Somebody deleted \fIfile\fP from the repository.
  72. .)l
  73. .)b
  74.  
  75. .(b
  76. .ip "\fBWhat if I want more information about my copy of a file?\fP"
  77. .sp
  78. The command \fBscvs status\fP \fIfile\fP 
  79. will give you RCS information about the your copy of a file and
  80. the latest version of the file.
  81. Here is
  82. some sample output for the file \fItimerInt.h\fP.
  83. .(l
  84. File:    timerInt.h
  85. From:    9.8    Fri Sep 13 15:04:52 1991 timerInt.h
  86. RCS:    9.9    /sprite/src/kernel/Cvsroot/kernel/timer/timerInt.h,v
  87. .)l
  88. .ip
  89. The \fIFrom:\fP line tells you that your copy of \fItimerInt.h\fP 
  90. came from RCS version 9.8 of that file, and that you created the
  91. copy on Friday, September 13, 1991 at 15:04:52.  The \fIRCS:\fP
  92. line tells you that the latest RCS version of the file is 9.9,
  93. and it gives you the full path to the RCS file, not that you would
  94. ever need it.
  95. .)b
  96.  
  97. .(b
  98. .ip "\fBHow do I get the RCS log for my copy of a file?\fP"
  99. .sp
  100. \fBScvs log\fP \fIfile\fP will print out the RCS log for the file.
  101. .)b
  102.  
  103. .(b
  104. .ip "\fBHow do I run diff on my copy of a file?\fP"
  105. .sp
  106. \fBScvs diff\fP \fIfile\fP will do a \fBrcsdiff\fP between your
  107. copy of a file and the version from which it came.  If you want
  108. to do a diff between your version and the latest version you
  109. should do \fBscvs diff \-R\fP \fIfile\fP.
  110. You can also do diffs between various versions of the file by specifying
  111. the standard \fB\-r\fP options.
  112. .)b
  113.  
  114. .(b
  115. .ip "\fBHow do I bring my copy up-to-date with the latest version?\fP"
  116. .sp
  117. If your copy of the sources is out-of-date 
  118. with the latest version in the repository
  119. you can update it using
  120. \fBscvs update\fP [\fImodules|subdirs|files\fP].  
  121. If you don't specify any files it will update all
  122. files in the current directory and its subdirectories, otherwise it will
  123. only update the files or subdirectories
  124. you listed.  If \fBscvs update\fP discovers that
  125. you have modified a file, and the copy of the file in the repository 
  126. has changed also, it will use \fBrcsmerge\fP to try and merge the changes.
  127. If this happens you will want to look at the file to make sure the
  128. changes were compatible.  The output from \fBscvs update\fP is similar to
  129. that of \fBscvs info\fP:
  130. .(l
  131. \fBU\fP \fIfile\fP    Your copy of \fIfile\fP was updated.
  132. \fBM\fP \fIfile\fP    Your changes to \fIfile\fP were merged with the new version.
  133. \fBC\fP \fIfile\fP    Your changes to \fIfile\fP were merged, but there was a conflict.
  134. \fBA\fP \fIfile\fP    You've added \fIfile\fP.
  135. \fBR\fP \fIfile\fP    You've removed \fIfile\fP.
  136. \fBD\fP \fIfile\fP    \fIfile\fP was deleted from your sources.
  137. .)l
  138. .ip
  139. An "update" target has been added to the Makefile for kernel modules
  140. so that \fBpmake update\fP will run \fBscvs update\fP.
  141. This is useful for updating all modules in \fC/sprite/src/kernel\fP.
  142. .)b
  143.  
  144. .(b
  145. .ip "\fBWho else has a copy of the same module?\fP"
  146. .sp
  147. When you check out a module you will be told about other users who
  148. also have a copy.
  149. You can also find out by doing \fBscvs who\fP [\fImodules\fP].
  150. .)b
  151.  
  152. .(b
  153. .ip "\fBWhat if I just want to look at the sources for a module?\fP"
  154. .sp
  155. Copies of all kernel modules are kept in \fC/sprite/src/kernel\fP.
  156. These copies are read-only so don't try to modify them. 
  157. These copies can be used for browsing, as well as for building the
  158. object files that are used to produce official kernels.
  159. .)b
  160.  
  161. .(b
  162. .ip "\fBHow do I add a new file to a module?\fP"
  163. .sp
  164. \fBScvs\fP only deals with files it knows about.  
  165. If \fBscvs\fP hasn't been told about a file it will 
  166. be ignored by any \fBscvs\fP commands.
  167. To add a file to a module create the file in your copy of the module,
  168. then type
  169. \fBscvs add\fP \fIfile\fP.  
  170. The file must exist in order to be added.
  171. The file will not be added to the repository until you \fBcommit\fP your
  172. changes.  
  173. .)b
  174.  
  175. .(b
  176. .ip "\fBHow do I add a new subdirectory to a module?\fP"
  177. .sp
  178. Subdirectories are added using \fBscvs add\fP 
  179. in your copy of a module
  180. just like files, except
  181. that you will be asked if you really want to do this.  If the subdirectory
  182. contains any files they must be added individually (\fBadd\fP is not recursive).
  183. .)b
  184.  
  185. .(b
  186. .ip "\fBHow do I remove a file from a module?\fP"
  187. .sp
  188. In your copy of a module type
  189. \fBscvs remove\fP \fIfile\fP to remove a file.
  190. If the file still exists it will be deleted.
  191. The file will not be removed from the repository until you \fBcommit\fP your
  192. changes.
  193. .)b
  194.  
  195. .(b
  196. .ip "\fBOops. I just accidently removed a file from my copy!\fP"
  197. .sp
  198. If you haven't \fBcommit\fPted your changes yet, you can retrieve 
  199. the file using \fBscvs add\fP \fIfile\fP.
  200. It will give you the version of the file you originally checked out.
  201. .)b
  202.  
  203. .(b
  204. .ip "\fBHow do I add a new module to the repository?\fP"
  205. .sp
  206. Don't try this at home.  Send mail to jhh@sprite.
  207. .)b
  208.  
  209. .(b
  210. .ip "\fBHow do I undo my changes to a file?\fP"
  211. .sp
  212. Currently the best way to do this is to use
  213. \fBscvs remove\fP \fIfile\fP, followed by \fBscvs add\fP \fIfile\fP. 
  214. This will give you the version of the file you originally checked out.
  215. .)b
  216.  
  217. .(b
  218. .ip "\fBHow do I commit my changes to a module?\fP"
  219. .sp
  220. After you have made your changes to a module 
  221. you need to commit them into the repository.
  222. There are several steps in committing your changes:
  223. .np
  224. Verify that your copy is up-to-date and it works properly.
  225. .np
  226. Lock the module(s) using \fBscvs lock\fP [\fImodules\fP].
  227. Locking the modules prevents other users from committing changes
  228. at the same time.
  229. .np
  230. Use \fBscvs commit\fP [\fIfiles\fP] (\fBcommit\fP is usually
  231. abbreviated
  232. as \fBci\fP) to commit your changes.  
  233. Each \fBscvs ci\fP command allows you to specify one log message
  234. (either using \fB\-m\fP or by bringing up an editor).  
  235. If you want all the files you modified
  236. to have the same message use \fBscvs ci\fP
  237. without any options,
  238. otherwise you must run \fBscvs ci\fP once for each message and
  239. corresponding list of files.
  240. .np
  241. As you commit your changes the copy of the sources
  242. in \fC/sprite/src/kernel/\fP\fImodule\fP
  243. will be updated.
  244. These copies are used to build kernels, so you need to recompile any
  245. source files you may have changed.
  246. To do this cd to \fC/sprite/src/kernel/\fP\fImodule\fP.
  247. Run \fBmkmf\fP, followed by \fBpmake\fP.
  248. Make sure the resulting object files produce a working kernel.
  249. Then run \fBpmake install\fP.
  250. Be sure to compile and install for all machine types.
  251. If the sources don't build a working kernel then you
  252. may have forgotten to \fBadd\fP 
  253. or \fBremove\fP a file.
  254. .np
  255. Unlock the modules using \fBscvs unlock\fP [\fImodules\fP].
  256. Don't forget to do this.
  257. .)b
  258.  
  259. .(b
  260. .ip "\fBWhat do I do when I'm done with my copy?\fP"
  261. .sp
  262. \fBscvs done\fP
  263. lets \fBscvs\fP know that you are done with your copy,
  264. so that other users will no longer be told about it.
  265. The \fB\-d\fP option will delete your copy.
  266. Use the \fB\-d\fP option with care.
  267. If you deleted your copy using \fBrm\fP without running \fBscvs done\fP
  268. first then \fBscvs\fP will think you still have a copy.
  269. You set it straight with \fBscvs done\fP \fIpathname\fP,
  270. where \fIpathname\fP is the full pathname of the copy you used to have.
  271. .)b
  272.  
  273. .(b
  274. .ip "\fBHow do I unlock a locked module?\fP"
  275. .sp
  276. If \fBsvcs\fP is killed unexpectedly it will leave 
  277. locks on any modules
  278. it was processing at the time.
  279. If you have an unwanted lock on a module you can remove it with
  280. \fBscvs unlock\fP [\fImodules\fP].
  281. If you want to remove all locks on a module, even those owned by other
  282. people, you can do so with \fBscvs unlock -a\fP [\fImodules\fP].
  283. .)b
  284.